package com.shell.governor.user.service.impl;

import com.shell.bee.persistence.service.impl.PersistentServiceImpl;
import com.shell.governor.user.dao.PubUserOptDao;
import com.shell.governor.user.po.PubUserOpt;
import com.shell.governor.user.service.PubUserOptService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PubUserOptServiceImpl extends PersistentServiceImpl<PubUserOpt> implements PubUserOptService {
	@Autowired
	PubUserOptDao userOptDao;

	public PubUserOpt getLastOpt(String userId, String entId) {
		List<PubUserOpt> userOpts = this.userOptDao.getLastOpt(userId, entId);
		if ((userOpts != null) && (userOpts.size() > 0)) {
			return (PubUserOpt) userOpts.get(0);
		}
		return null;
	}
}
